<template>
  <div>App</div>
  <!-- 
    v-memo 用来缓存DOM元素
      v-memo="[依赖项1...]"
      当依赖项发送变化就会重新渲染，不变就不会
   -->
  <div v-memo="[count]">
    <p>{{ count }}</p>
    <button @click="count++">按钮</button>

    <p>{{ num }}</p>
    <button @click="num++">按钮</button>
  </div>
</template>

<script lang="ts">
export default {
  name: "App",
};
</script>

<script lang="ts" setup>
import { ref } from "vue";

const count = ref(0);
const num = ref(0);
</script>

<style scoped></style>
